/* import request from './request.js'; */
import fetch from "./request.js";

export function login(data) {
  return fetch("/nb-pc/1.0.1/LoginService/login", {
    method: "post",
    data,
    withLoading: true,
  });
}
export function logout() {
  return fetch("/nb-pc/1.0.1/LoginService/logout", {
    method: "post",
    withLoading: true,
  });
}

// 查询用户
export function queryAccountList(data) {
  return fetch("/nb-as/1.0.1/AccountService/queryAccountList", {
    method: "post",
    data: data,
  });
}
// 查询角色列表（查询账号列表筛选条件选择角色/新增账号选择角色）
export function queryRoleList(data) {
  return fetch("/nb-as/1.0.1/RoleService/queryRoleList", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 新增用户
export function addAccount(data) {
  return fetch("/nb-as/1.0.1/AccountService/addAccount", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 修改用户
export function updateAccount(data) {
  return fetch("/nb-as/1.0.1/AccountService/updateAccount", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 删除用户
export function deleteAccount(data) {
  return fetch("/nb-as/1.0.1/AccountService/deleteAccount", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 查询账号详情
export function queryAccountDetail(data) {
  return fetch("/nb-as/1.0.1/AccountService/queryAccountDetail", {
    method: "post",
    data: data,
    headers:{
      "Content-Type":"application/json; charset=utf-8"
    },
    withLoading: true,
  });
}
// 批量导入
export function importAccount(data) {
  return fetch("/nb-as/1.0.1/AccountService/importAccount", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 查询账户关联页面的角色列表
export function queryBindRoleListByPage(data) {
  return fetch("/nb-as/1.0.1/AccountService/queryBindRoleListByPage", {
    method: "post",
    data: data,
  });
}
// 查询账号关联页面树
export function queryPageTreeByAccount(data) {
  return fetch("/nb-as/1.0.1/AccountService/queryPageTreeByAccount", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 查询账号关联角色列表（穿梭框UI交互）
export function queryBindRoleList(data) {
  return fetch("/nb-as/1.0.1/AccountService/queryBindRoleList", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 修改账号关联角色
export function updateAccountRole(data) {
  return fetch("/nb-as/1.0.1/AccountService/updateAccountRole", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 冻结/锁定账号
export function lockAccount(data) {
  return fetch("/nb-as/1.0.1/AccountService/lockAccount", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 解锁账号
export function unlockAccount(data) {
  return fetch("/nb-as/1.0.1/AccountService/unlockAccount", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 修改用户管理列表重置指定账号密码
export function updatePassword(data) {
  return fetch("/nb-as/1.0.1/AccountService/updatePassword", {
    method: "post",
    data: data,
    withLoading: true,
  });
}

// 重置登录密码
export function resetPassword(data) {
  return fetch("/nb-as/1.0.1/AccountService/resetPassword", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 导出
export function exportAccount(data) {
  return fetch("/nb-as/1.0.1/AccountService/exportAccount", {
    method: "post",
    data: data,
    withLoading: true,
    responseType: "blob",
    noInterceptors:true
  });
}
